package cn.xhb.mapper;

import cn.xhb.domain.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
public interface UserMapper {

    @Select("select * from user where username=#{userName}")
    User findByUserName(@Param("userName") String userName);
    @Insert("insert into user(userName,password,email,phoneNum) values(#{userName},#{password},#{email},#{phoneNum}) ")
    @Options(useGeneratedKeys = true,keyProperty = "id")
    void add(User user);
}
